package org.footballmanager.pandafootball.system.service;

import org.footballmanager.pandafootball.system.domain.FootMission;
import org.footballmanager.pandafootball.system.domain.enums.SJZT;
import org.footballmanager.pandafootball.system.form.impl.FootMissionSearchForm;
import org.springframework.ui.Model;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface FootMissionService extends BaseService<FootMission> {
	/**
	 * 结束所有任务，并添加新任务
	 * @param sjzt
	 * @param request
	 */
	void addNewMission(SJZT sjzt, HttpServletRequest request);

	/**
	 * 根据玩家主键结束对应任务
	 * @param userId
	 * @param isReshen
	 * @param request
	 */
	void finishMission(Long userId, boolean isReshen, HttpServletRequest request);

	/**
	 * 领取任务奖励
	 * @param userId
	 * @param isReshen
	 * @param request
	 */
	void getMissionMoney(Long userId, boolean isReshen, HttpServletRequest request);

	/**
	 * 根据玩家和时间找对应任务
	 * @param userId
	 * @param sjzt
	 * @return
	 */
	FootMission findMissionByUserIdandStatus(Long userId, SJZT sjzt);
	
	/**
	 * 根据玩家找所有对应任务
	 * @param userId
	 * @return
	 */
	List<FootMission> findMissionsByUserId(Long userId);

    /**
     * 翻页方法
     * @param footMissionSearchForm 条件
     * @return 列表
     */
    List<FootMission> findall(FootMissionSearchForm footMissionSearchForm);

    /**
     * 查询
     * @param entityname 实体类名
     * @param map 参数
     * @param footMissionSearchForm 条件
     */
    void search(String entityname, Model map, FootMissionSearchForm footMissionSearchForm);
}